Lumen & Gesso / website · lumengesso.com / app / api / auth / [...action] / route.ts
| 1 | import { lumenAuth } from '@/app/lib/lumen-auth'; |
| 2 | |
| 3 | export const dynamic = 'force-dynamic'; |
| 4 | |
| 5 | // Only private order links and passkey endpoints are exposed. Passkeys are the only sign-in. |
| 6 | const GET_PATHS = new Set([ |
| 7 | '/api/auth/magic-link/verify', |
| 8 | '/api/auth/passkey/generate-register-options', |
| 9 | '/api/auth/passkey/generate-authenticate-options', |
| 10 | '/api/auth/passkey/list-user-passkeys', |
| 11 | ]); |
| 12 | const POST_PATHS = new Set([ |
| 13 | '/api/auth/passkey/verify-authentication', |
| 14 | '/api/auth/passkey/verify-registration', |
| 15 | '/api/auth/passkey/delete-passkey', |
| 16 | ]); |
| 17 | |
| 18 | export function GET(request: Request) { |
| 19 | if (!GET_PATHS.has(new URL(request.url).pathname)) return new Response(null, { status: 404 }); |
| 20 | return lumenAuth().handler(request); |
| 21 | } |
| 22 | |
| 23 | export function POST(request: Request) { |
| 24 | if (!POST_PATHS.has(new URL(request.url).pathname)) return new Response(null, { status: 404 }); |
| 25 | return lumenAuth().handler(request); |
| 26 | } |